<?php
	$user = 'root';
	$pass = '';
	$dbh = new PDO('mysql:host=localhost;dbname=taxi', $user, $pass);
	
	$db_host = 'localhost';
    $db_user = 'root';
   	$db_pass = '';
  // Подключение к базе данных MySQL.
  @$on_link = mysqli_connect($db_host, $db_user, $db_pass);
  if (!$on_link) {
  echo "Ошибка соединения с сервером MySQL!";
  exit;
  }
// изменение набора символов на utf8
  mysqli_set_charset($on_link, "utf8");
// Выбираем БД для работы в MySQL.
	$db_base_ref = 'taxi';
  @$db_select = mysqli_select_db ($on_link, $db_base_ref);
    if (!$db_select) {
    echo "Не удалось выбрать БД MySQL.";
    exit;
    }
				if(isset($_SESSION['logged_user'])) :
				$phkl = $_SESSION['logged_user']->phone_client;
				$rolekl = $_SESSION['logged_user']->role;
				else : 
				endif;
?>

	<!DOCTYPE html>
	<html lang="zxx" class="no-js">
	<head>
		<!-- Mobile Specific Meta -->
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<!-- Favicon-->
		<link rel="shortcut icon" href="img/fav.png">
		<!-- Author Meta -->
		<meta name="author" content="colorlib">
		<!-- Meta Description -->
		<meta name="description" content="">
		<!-- Meta Keyword -->
		<meta name="keywords" content="">
		<!-- meta character set -->
		<meta charset="UTF-8">
		<!-- Site Title -->
		<title>Taxi</title>

		<link href="https://fonts.googleapis.com/css?family=Poppins:100,200,400,300,500,600,700" rel="stylesheet"> 
			<!--
			CSS
			============================================= -->
			<link rel="stylesheet" href="css/linearicons.css">
			<link rel="stylesheet" href="css/font-awesome.min.css">
			<link rel="stylesheet" href="css/bootstrap.css">
			<link rel="stylesheet" href="css/magnific-popup.css">
			<link rel="stylesheet" href="css/nice-select.css">							
			<link rel="stylesheet" href="css/animate.min.css">
			<link rel="stylesheet" href="css/jquery-ui.css">			
			<link rel="stylesheet" href="css/main.css">
			
		</head>

<body>


	
	<!-- Start Header Area -->
			  <header id="header">
		  		<div class="header-top">
				</div>
			    <div class="container main-menu">
			    	<div class="row align-items-center justify-content-between d-flex">
			    		<a href="index.php"><img src="img/logo.png" alt="" title="" /></a>		
						<nav id="nav-menu-container">
							<ul class="nav-menu">
							  <li class="menu-active"><a href="index.php">Главная</a></li>

							  <li><a href="auto.php">Наш автопарк</a></li>						  			          	          
							  <li><a href="contact.php">Контакты</a></li>
							  <?php if(isset($_SESSION['logged_user'])) : ?>
							  <li><a href="lk.php">Личный кабинет</a></li>
							  <?php else : ?>
							  <li><a href="login.php">Войти</a></li>
							  <?php endif; ?>
							</ul>
						</nav><!-- #nav-menu-container -->		
			    	</div>
			    </div>
			  </header><!-- #header -->
	<!-- End Header Area -->

	

				<section class="banner-area relative" id="home">
				<div class="overlay overlay-bg"></div>	
				<div class="container">
					<div class="row fullscreen d-flex align-items-center">
						<div class="col-lg-12  col-md-12">
							<div class="container" >
									  <form name="f1" method="post" action="search.php">
		  <div class="input-group rounded">
			<input type="search" class="form-control rounded" name="search" style="font-family:Arial;bottom: 70px;" placeholder="Поиск" aria-label="Search"
				aria-describedby="search-addon" />
				</span>
		  </div>
		  </form>
		<center>
<div class="container">
			<div class='card-columns'>
	<?php
  $sql = "SELECT * FROM `auto`";
  $result_select = mysqli_query($on_link, $sql);
  
	while($obj = mysqli_fetch_object($result_select)){
		echo "<div class='card text-white bg-dark mb-3'>";
		echo "<img class='card-img-top' src='img/$obj->photo_car' >";
		echo "<div class='card-body'>";
		echo "<h5 class='card-title text-white'> $obj->name_car</h5>";
		echo "</div>";
		echo "</div>";
		}
?>	
			 </div>
</div>
		</center>
        </div>
						</div>											
					</div>
				</div>					
			</section>






			<footer class="footer-area dunku">
				
							<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->
<div align="center"> Copyright &copy;<script>document.write(new Date().getFullYear());</script> All rights reserved </div>
<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->
						</p>											
				<img class="footer-bottom" src="img/footer-bottom.png" alt="">
			</footer>	
			<!-- End footer Area -->	

			<script src="js/vendor/jquery-2.2.4.min.js"></script>
			<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
			<script src="js/vendor/bootstrap.min.js"></script>			
			<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBhOdIF3Y9382fqJYt5I_sswSrEw5eihAA"></script>
  			<script src="js/easing.min.js"></script>			
			<script src="js/hoverIntent.js"></script>
			<script src="js/superfish.min.js"></script>	
			<script src="js/jquery.ajaxchimp.min.js"></script>
			<script src="js/jquery.magnific-popup.min.js"></script>	
 			<script src="js/jquery-ui.js"></script>								
			<script src="js/jquery.nice-select.min.js"></script>							
			<script src="js/mail-script.js"></script>	
			<script src="js/main.js"></script>	
</body>

</html>